/*
 * Copyright (c) 2022. Atguigu Inc. All Rights Reserved.
 * Date: 2022/4/27 下午9:36.
 * Author: Administrator.
 */

package com.min.controller;

import com.min.domain.UserBehavior;
import com.min.domain.UserBehaviorType;
import com.min.domain.ViewingHours;
import com.min.service.UserBehaviorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api")
public class UserBehaviorController {


    @Autowired
    private UserBehaviorService userBehaviorService;



    /**
     * 用户点行为
     * @return
     */
    @GetMapping("/userBehavior")
    public UserBehavior getUserBehavior(){

        System.out.println(userBehaviorService.getUserBehavior().toString());
        return  userBehaviorService.getUserBehavior();
    }
    /**
     *  浏览时长占比
     */
    @GetMapping("/viewingHours")
    public ViewingHours getviewingHours(){

        return  userBehaviorService.getviewingHours();
    }

    /**
     * 用户点击行为类型
     */
    @GetMapping("/userBehaviorType")
    public List<UserBehaviorType> getuserBehaviorType(){

        return  userBehaviorService.getuserBehaviorType();
    }

}
